<link type="text/css" rel="stylesheet" href="{{ asset('bundles/rtscraftmain/css/article.css') }}">

<div id="article_nav">
  {% if article.articleId.element.category.name is defined %}
  <a href="#" class="breadcrumb">{{article.articleId.element.category.name}}</a>
  &rarr;
  <a href="#" class="breadcrumb">{{article.articleId.element.name}}</a>
  {% else %}
  <a href="#" class="breadcrumb">{{article.articleId.title}}</a>
  {% endif %}
</div>

<div id="results">
  <!-- put ajax requests results here -->

  {% if article.articleId.element.name is defined %}
  <div id="entityCard">
  </div>

  <script type="text/javascript">
    entity_asynch_load('{{ path('_entity_display') }}',
    '{{ article.articleId.element.name }}');
  </script>
  {% else %}
   <style type="text/css">#text_article {width: 95%;}</style>
  {% endif %}

  <div id="text_article">
    {% if is_auth == true %}
    <div id="admin_tools">
      <p>Outils d'administration</p>
      <ul class="tools_list">
	<li><a href="#" onclick="submitForm('edition/{{article.articleId.title}}')">Editer l'article</a></li>
	<li><a href="#" onclick="submitForm('history/{{article.articleId.title}}')">Historique de l'article</a></li>
	<li><a href="#">Effacer l'article</a></li>
      </ul>
    </div>
    {% endif %}

    {% if is_last is defined %}
    {% if is_last == false %}
      <div class="warning">
	Attention, ceci est une ancienne version de l'article (version {{article.numVersion}} du {{article.date | date("d/m/Y - H:i:s") }})
      </div>
    {% endif %}
    {% endif %}

    {{article.text | raw }}
  </div>
</div>
